﻿using MediatR;
using Reporting.API.DTOs.ProductionPlanDTO;
using Reporting.API.Utils;
using Reporting.Domain;
using Reporting.Domain.Enum;
using Reporting.Errorcode;

namespace Reporting.API.Application.Commands.ProductionPlans
{
    /// <summary>
    /// 生产计划添加
    /// </summary>
    public class AddProductionPlanCommand : IRequest<ApiResult>
    {
        /// <summary>
        /// 计划编号
        /// </summary>
        public string Plannumber { get; set; }

        /// <summary>
        /// 计划名称
        /// </summary>
        public string Planname { get; set; }

        /// <summary>
        /// 工单数量
        /// </summary>
        public int Quantityofworkorders { get; set; }

        /// <summary>
        /// 来源类型
        /// 外健
        /// </summary>
        public int SourcetypeID { get; set; }

        /// <summary>
        /// 成品名称
        /// </summary>
        public string Productname { get; set; }

        /// <summary>
        /// 成品编号
        /// </summary>
        public string Productnumber { get; set; }

        /// <summary>
        /// 规格型号
        /// </summary>
        public string Specificationandmodel { get; set; }

        /// <summary>
        /// 单位
        /// </summary>
        public string Unit { get; set; }

        /// <summary>
        /// 计划数量
        /// </summary>
        public int Plannedquantity { get; set; }

        /// <summary>
        /// 计划开工日期
        /// </summary>
        public DateTime Plannedcommencementdate { get; set; }

        /// <summary>
        /// 计划完工日期
        /// </summary>
        public DateTime Plannedcompletiondate { get; set; }

        /// <summary>
        /// 需求日期
        /// </summary>
        public DateTime Requirementdate { get; set; }

        /// <summary>
        /// 状态
        /// </summary>
        public StateEnum State { get; set; }
    }

    /// <summary>
    /// 显示生产计划
    /// </summary>
    public class GetProductionPlanCommand : IRequest<ApiResult<PagingResult<IList<ProductionPlanResponse>>>>
    {

        /// <summary>
        /// 计划编号/名称
        /// </summary>
        public string? PlannumberPlanname { get; set; }

        /// <summary>
        /// 来源类型
        /// 外健
        /// </summary>
        public int? SourcetypeID { get; set; }
        /// <summary>
        /// 产品名称
        /// </summary>
        public string? Productname { get; set; }

        /// <summary>
        /// 状态
        /// </summary>
        public StateEnum? State { get; set; }

        /// <summary>
        /// 当前页
        /// </summary>
        public int PageIndex { get; set; }

        /// <summary>
        /// 页容量
        /// </summary>
        public int PageSize { get; set; }
    }
    
    
    /// <summary>
    /// 删除生产计划
    /// </summary>
    public class DelProductionPlanCommand : IRequest<ApiResult>
    {
        /// <summary>
        /// 生产计划ID
        /// </summary>
        public int Productionplanid { get; set; }
    }
    
    /// <summary>
    /// 修改生产计划
    /// </summary>
    public class UpdProductionPlanCommand : IRequest<ApiResult>
    {
        /// <summary>
        /// 生产计划ID
        /// </summary>
        public int Productionplanid { get; set; }

        /// <summary>
        /// 计划编号
        /// </summary>
        public string Plannumber { get; set; }

        /// <summary>
        /// 计划名称
        /// </summary>
        public string Planname { get; set; }

        /// <summary>
        /// 工单数量
        /// </summary>
        public int Quantityofworkorders { get; set; }

        /// <summary>
        /// 来源类型
        /// 外健
        /// </summary>
        public int SourcetypeID { get; set; }

        /// <summary>
        /// 成品名称
        /// </summary>
        public string Productname { get; set; }

        /// <summary>
        /// 成品编号
        /// </summary>
        public string Productnumber { get; set; }

        /// <summary>
        /// 规格型号
        /// </summary>
        public string Specificationandmodel { get; set; }

        /// <summary>
        /// 单位
        /// </summary>
        public string Unit { get; set; }

        /// <summary>
        /// 计划数量
        /// </summary>
        public int Plannedquantity { get; set; }

        /// <summary>
        /// 计划开工日期
        /// </summary>
        public DateTime Plannedcommencementdate { get; set; }

        /// <summary>
        /// 计划完工日期
        /// </summary>
        public DateTime Plannedcompletiondate { get; set; }

        /// <summary>
        /// 需求日期
        /// </summary>
        public DateTime Requirementdate { get; set; }

        /// <summary>
        /// 状态
        /// </summary>
        public StateEnum State { get; set; }
    }    //修改生产计划

    /// <summary>
    /// id反填生产计划
    /// </summary>
    public class ReverseProductionPlanCommand : IRequest<ApiResult<ProductionPlan>>
    {
        /// <summary>
        /// 生产计划ID
        /// </summary>
        public int Productionplanid { get; set; }
    }

    /// <summary>
    /// 查询所有的生产计划
    /// </summary>
    public class SelectCompleteProductionPlanCommand : IRequest<ApiResult<IList<SelectCompleteProductionPlanResponse>>>
    {
  
    }


}
